<script setup>
  import { reactive } from "vue";
  import { onShow } from "@dcloudio/uni-app";

  const handleBackJumpRedirectUrl = () => {
    const url = getApp().globalData.jumpRedirectUrl
    if (!url) return
    getApp().globalData.jumpRedirectUrl = ''
    uni.navigateTo({ url })
  }

  onShow(() => {
    state.visible = !!getApp().globalData.jumpRedirectUrl
  })

  const state = reactive({
    src: '',
    visible: false
  })
</script>

<template>
  <view v-if="state.visible" @click.stop="handleBackJumpRedirectUrl">
    <slot></slot>
  </view>
</template>

<style lang="scss" scoped>

</style>
